import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Test18 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String string = sc.next();
        Map<Character,Integer> counts= new HashMap<>();
        for (char c: string.toCharArray()) {
            counts.put(c,counts.getOrDefault(c,0)+1);
        }
        char maxChar='A';
        int maxNum=0;
        for (Map.Entry<Character,Integer> entry: counts.entrySet()  ) {
            if (entry.getValue()>maxNum){
                maxChar=entry.getKey();
                maxNum= entry.getValue();
            }
        }
        System.out.println(maxChar);
        for (Map.Entry<Character,Integer> entry:
             counts.entrySet()) {
            if (entry.getValue()<maxNum){
                maxNum= entry.getValue();
                maxChar= entry.getKey();
            }
        }
    }
}
